Skip to content

feat: #[wgsl_ignore]#106

Merged
schell merged 3 commits into
mainfrom
feat/wgsl-ignore-attribute
May 3, 2026
Merged

feat: #[wgsl_ignore]#106
schell merged 3 commits into
mainfrom
feat/wgsl-ignore-attribute

Conversation

@schell

@schell schell commented May 3, 2026

Copy link
Copy Markdown
Owner

These changes add a #[wgsl_ignore] attribute that can be placed on any module item. An item with this annotation is ignored by the parser and WGSL code gen. It passes through on the Rust side.

This is a feature needed by frameworks looking to add linkage and other Rust-side only features to their WGSL modules.

Requested in:

Copilot AI review requested due to automatic review settings May 3, 2026 02:00
Comment thread crates/example/src/examples.rs Fixed
Comment thread crates/example/src/examples.rs Fixed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new #[wgsl_ignore] attribute to the wgsl-rs macro surface so users can keep Rust-only items inside #[wgsl] modules without generating WGSL for them. It extends the public re-exports and adds parser-side support to skip annotated module items during WGSL generation.

Changes:

  • Re-export wgsl_ignore from wgsl-rs and wgsl_rs::std so it is available to downstream users.
  • Add parser logic in wgsl-rs-macros to detect #[wgsl_ignore] on module items and omit those items from generated WGSL.
  • Add an example module demonstrating a Rust-only constant annotated with #[wgsl_ignore].

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
crates/wgsl-rs/src/std.rs Re-exports wgsl_ignore through the std prelude used in #[wgsl] modules.
crates/wgsl-rs/src/lib.rs Re-exports wgsl_ignore from the crate root for downstream use.
crates/wgsl-rs-macros/src/parse.rs Adds detection of #[wgsl_ignore] and skips annotated module items during WGSL parsing.
crates/wgsl-rs-macros/src/lib.rs Defines the wgsl_ignore proc-macro attribute and documents intended behavior.
crates/example/src/examples.rs Adds a small example showing a Rust-only item ignored by WGSL generation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/wgsl-rs-macros/src/parse.rs Outdated
Comment thread crates/wgsl-rs-macros/src/lib.rs Outdated
Comment thread crates/wgsl-rs-macros/src/parse.rs Outdated
@schell schell merged commit 970b938 into main May 3, 2026
6 checks passed
schell added a commit that referenced this pull request May 29, 2026
* feat: #[wgsl_ignore]

* warnings

* better way to wgsl_ignore
@schell schell deleted the feat/wgsl-ignore-attribute branch June 1, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants